﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IdentityServer.Models
{
    /// <summary>
    /// 用户表
    /// </summary>
    [Table("user")]
    public class User
    {
        /// <summary>
        /// Id
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 是否有效
        /// </summary>
        public bool Active { get; set; }
        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 更新日期
        /// </summary>
        public DateTime UpdateTime { get; set; }
        /// <summary>
        /// 账户名
        /// </summary>
        public string UserCode { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string NickName { get; set; }
        /// <summary>
        /// 用户头像
        /// </summary>
        public string? HeaderImage { get; set; }
        /// <summary>
        /// 角色编码
        /// </summary>
        public string RoleCodes { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public GenderType Gender { get; set; }
        /// <summary>
        /// 联系方式
        /// </summary>
        public string Tel { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }
        /// <summary>
        /// 家庭住址
        /// </summary>
        public string? Address { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }
    }

    /// <summary>
    /// 性别枚举
    /// </summary>
    public enum GenderType
    {
        /// <summary>
        /// 男
        /// </summary>
        [Display(Name = "男")]
        Male = 0,
        /// <summary>
        /// 女
        /// </summary>
        [Display(Name = "女")]
        FeMale = 1
    }
}
